package com.byit.Test.test2;

/**
 * @ClassName Thread2
 * @Description TODO
 * @Author lxp
 * @Date 2018/10/8 0008
 **/
public class Thread2 implements Runnable {

    private String name;

    public Thread2(String name) {
        this.name=name;
    }

    @Override
    public void run() {
        for (int i = 0; i <5 ; i++) {
            System.out.println(name+"运行："+i);
            try {
                Thread.sleep((int) Math.random() * 10);
            }catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
